<?php

//OCP\JSON::callCheck();

$key = JRequest::getString('key', null);
$val = JRequest::getInt('val', 0);

if($key == 'showsearch' || $key == 'showmorejob' || $key == 'showdetail' || $key == 'showsearchresumedetails') {
   // update session to hide the advanced search
   $app = PFactory::getApplication();
   $resumedir = $app->getUserState('resumedir', null);
   if ($resumedir) {
      $resumedir[$key] = $val;
   } else {
      $resumedir = array($key => $val);
   }
   
   $app->setUserState('resumedir', $resumedir);
   
   OCP\JSON::success();
}